package cn.shopthrive.merchants;

import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;

public class WeChatModule extends ReactContextBaseJavaModule {
  public WeChatModule(ReactApplicationContext ctx) {
    super(ctx);
  }

  @Override
  public String getName() {
    return "WeChatHelper";
  }

  @ReactMethod
  public void isWeChatInstalled(Promise p) {
    p.resolve(WeChatHelper.isWeChatInstalled());
  }

  @ReactMethod
  public void login(Promise p) {
    p.resolve(WeChatHelper.login());
  }
}
